<template>
  <div class="rankingsList">
    <div class="title">{{title}}</div>
    <div
      class="mousrtext"
      @mouseover="mouseOver(index)"
      v-for="(item, index) in favoriteList"
      :key="index"
    >
      <!-- 鼠标未移入显示 -->

      <div v-show="mousreindex != index" class="inroduce">
        <span class="num">{{ index + 1 }}</span>
        <span class="bookname">{{ item.book_name }}</span>
        <!-- <span class="el-icon-top iconcolor"></span> -->
      </div>
      <!-- 鼠标移入显示 -->
      <BookIntroduce
        v-show="mousreindex == index"
        :booksList="item"
        isShowyangshi="true"
      />
    </div>
  </div>
</template>

<script>
import BookIntroduce from "../components/BrowseChile/BookIntroduce.vue";
export default {
  props: ["favoriteList",'title'],
  data() {
    return {
      mousreindex: "0",//初始化显示
    };
  },
  methods: {
    mouseOver(index) {
      this.mousreindex = index;
    },
  },
  components: {
    BookIntroduce,
  },
};
</script>

<style lang = 'less' scoped>
.rankingsList {
  width: 358px;
  height: 785px;
  margin-bottom: 24px;
  .title {
    font-size: 22px;
    font-weight: 650;
    line-height: 42px;
    color: #333333;
    margin-bottom: 16px;
  }
  .inroduce {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    .num {
      width: 35px;
      font-size: 22px;
      font-family: DIN;
      color: #c7c7c7;
    }
    .bookname {
      font-size: 18px;
      font-weight: 500;
      color: #333333;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .iconcolor {
      color: #fb6e3b;
      line-height: 22px;
      font-size: 16px;
      margin-left: 10px;
    }
  }
}
.mousrtext:nth-child(2) {
  .num {
    color: #f99b2e !important;
  }
}
.mousrtext:nth-child(3) {
  .num {
    color: #2ea3f9 !important;
  }
}
.mousrtext:nth-child(4) {
  .num {
    color: #fb6e3b !important;
  }
}
</style>